import http from '../utils/request'

export function addCartRequest( userid,proid,num = 1) {
  return http({
    method: 'post',
    url: '/api/cart/add',
    data: {
      userid,
      proid,
      num,
    },
  })
}

export function getCartListRequest() {
  let userid = localStorage.getItem('mallFrontUserid')
  return http({
    method: 'post',
    url: '/api/cart/list',
    data: {
      userid,
    },
  })
}


export function cartDelRequest(cartid) {
  return http({
    method: 'post',
    url: '/api/cart/remove',
    data: {
      cartid,
    },
  })
}